#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
int main_1008()
{
    LL N,t=0,src=0,target;
    scanf("%lld",&N);
    for (int i=0;i<N ;++i )
    {
        scanf("%lld",&target);
        if (target>src)
        {
            t+=(target-src)*6+5;
        }
        else
        {
            t+=(src-target)*4+5;
        }
        src=target;
    }
    printf("%lld",t);
    return 0;
}
